package cn.darkhorse.device.service;

import cn.darkhorse.device.pojo.MesSpareApplyRecords;
import cn.darkhorse.device.vo.MesSpareApplyRecordsVO;
import com.baomidou.mybatisplus.extension.service.IService;

import java.math.BigDecimal;
import java.util.List;

/**
 * <p>
 * 备件申请记录表 服务类
 * </p>
 *
 * @author maoguanjun
 * @since 2022-11-11
 */
public interface MesSpareApplyRecordsService extends IService<MesSpareApplyRecords> {

    /**
     * 列表
     * @param deptId
     * @param spareName
     * @return
     */
    List<MesSpareApplyRecordsVO> listAll(Long deptId, String spareName,Long repairId,String orderType);

    /**
     * 查看
     * @param id
     * @return
     */
    MesSpareApplyRecordsVO view(Long id);

    /**
     * 保存
     * @param mesSpareApplyRecords
     * @return
     */
    boolean saveSpareApplyRecords(MesSpareApplyRecords mesSpareApplyRecords,Integer Type);

    /**
     * 删除
     * @param id
     * @return
     */
    boolean delete(Long id);

    /**
     * 删除
     * @param id
     * @return
     */
    boolean deleteByRepairId(Long id);

    /**
     * 提交
     * @param id
     * @return
     */
    boolean submit(Long id);

    /**
     * 审核
     * @param id
     * @param approver
     * @param approveTime
     * @return
     */
    boolean audit(Long id, Long approver, String approveTime,Integer auditStatus);

    /**
     * 弃审
     * @param id
     * @return
     */
    boolean waiver(Long id);

    /**
     * 发送消息信息
     * @param spareId
     * @param businessId
     * @param applyNum
     */
    void sendWarnMsg(Long spareId, Long businessId, BigDecimal applyNum);
}
